#include <bits/stdc++.h>
using namespace std;

vector<int> fans;
void dfs(int pos, int num, int &res, int sum, int target, int flag, bool ok) {
    if(sum > target || flag > 1 || num >= res) return ;
    if(sum == target) {
        res = num;
        ok = true;
        return ;
    }
    for(; pos < fans.size(); ++pos) {
        if(ok == true) return ;
        dfs(pos+1, num+1, res, sum+fans[pos]/2, target, flag, ok);
        dfs(pos+1, num+1, res, sum+fans[pos], target, flag+1, ok);
    }
}

int main() {
    int account, target_num;
    cin >> account >> target_num;
    fans.assign(account, 0);
    for(int i = 0; i < account; ++i) {
        cin >> fans[i];
    }
    int res = INT_MAX;
    sort(fans.begin(), fans.end(), [](int a, int b){return a > b;});
    dfs(0, 0, res, 0, target_num, 0, false);
    if(res == INT_MAX) {
        cout << "-1" << endl;
    }else {
        cout << res << endl;
    }
}